/************************************************
 * Author       :   XXY
 * Blog         :   https://www.cnblogs.com/jzyl
 * Gitee        :   https://gitee.com/xiaobaichong
 * Email        :   1047185209@QQ.com
 * FileName     :   Mono.cs
 * CreateData   :   2023/5/21 21:54:52
 * UnityVersion :   2021.3.20f1c1
 * Description  :   这只是一个MonoBehaviour脚本
************************************************/

using System;
using UnityEngine;

namespace Main
{
    /// <summary>
    /// <para>这是一个MonoBehaviour脚本</para>
    /// </summary>
    public class Mono : MonoBehaviour
    {
        public event Action EAwake;
        public event Action EOnEnable;
        public event Action EStart;
        public event Action EUpdate;
        public event Action ELateUpdate;
        public event Action EFixedUpdate;
        public event Action EOnDisable;
        public event Action EOnDestroy;
        #region 生命周期
        private void Awake()
        {
            EAwake?.Invoke();
        }
        private void OnEnable()
        {
            EOnEnable?.Invoke();
        }
        private void Start()
        {
            EStart?.Invoke();
        }
        private void Update()
        {
            EUpdate?.Invoke();
        }
        private void LateUpdate()
        {
            ELateUpdate?.Invoke();
        }
        private void FixedUpdate()
        {
            EFixedUpdate?.Invoke();
        }
        private void OnDisable()
        {
            EOnDisable?.Invoke();
        }
        private void OnDestroy()
        {
            EOnDestroy?.Invoke();
        }
        #endregion


        public event Action<Collision> EOnCollisionEnter;
        public event Action<Collision> EOnCollisionStay;
        public event Action<Collision> EOnCollisionExit;
        public event Action<Collision2D> EOnCollisionEnter2D;
        public event Action<Collision2D> EOnCollisionStay2D;
        public event Action<Collision2D> EOnCollisionExit2D;

        public event Action<Collider> EOnTriggerEnter;
        public event Action<Collider> EOnTriggerStay;
        public event Action<Collider> EOnTriggerExit;
        public event Action<Collider2D> EOnTriggerEnter2D;
        public event Action<Collider2D> EOnTriggerStay2D;
        public event Action<Collider2D> EOnTriggerExit2D;
        #region 物理
        private void OnCollisionEnter(Collision collision)
        {
            EOnCollisionEnter?.Invoke(collision);
        }
        private void OnCollisionStay(Collision collision)
        {
            EOnCollisionStay?.Invoke(collision);
        }
        private void OnCollisionExit(Collision collision)
        {
            EOnCollisionExit?.Invoke(collision);
        }
        private void OnCollisionEnter2D(Collision2D collision)
        {
            EOnCollisionEnter2D?.Invoke(collision);
        }
        private void OnCollisionStay2D(Collision2D collision)
        {
            EOnCollisionStay2D?.Invoke(collision);
        }
        private void OnCollisionExit2D(Collision2D collision)
        {
            EOnCollisionExit2D?.Invoke(collision);
        }

        private void OnTriggerEnter(Collider other)
        {
            EOnTriggerEnter?.Invoke(other);
        }
        private void OnTriggerStay(Collider other)
        {
            EOnTriggerStay?.Invoke(other);
        }
        private void OnTriggerExit(Collider other)
        {
            EOnTriggerExit?.Invoke(other);
        }
        private void OnTriggerEnter2D(Collider2D collision)
        {
            EOnTriggerEnter2D?.Invoke(collision);
        }
        private void OnTriggerStay2D(Collider2D collision)
        {
            EOnTriggerStay2D?.Invoke(collision);
        }
        private void OnTriggerExit2D(Collider2D collision)
        {
            EOnTriggerExit2D?.Invoke(collision);
        }
        #endregion


        public event Action EOnMouseDown;
        public event Action EOnMouseUp;
        public event Action EOnMouseOver;
        public event Action EOnMouseExit;
        public event Action EOnMouseDrag;
        public event Action EOnMouseEnter;
        #region 鼠标
        private void OnMouseDown()
        {
            EOnMouseDown?.Invoke();
        }
        private void OnMouseUp()
        {
            EOnMouseUp?.Invoke();
        }
        private void OnMouseOver()
        {
            EOnMouseOver?.Invoke();
        }
        private void OnMouseExit()
        {
            EOnMouseExit?.Invoke();
        }
        private void OnMouseDrag()
        {
            EOnMouseDrag?.Invoke();
        }
        private void OnMouseEnter()
        {
            EOnMouseEnter?.Invoke();
        }
        #endregion


        public event Action EOnBecameVisible;
        public event Action EOnBecameInvisible;
        public event Action EOnAnimatorMove;
        public event Action<int> EOnAnimatorIK;
        public event Action<GameObject> EOnParticleCollision;
        public event Action EOnParticleTrigger;
        #region 其他
        private void OnBecameVisible()
        {
            EOnBecameVisible?.Invoke();
        }
        private void OnBecameInvisible()
        {
            EOnBecameInvisible?.Invoke();
        }
        private void OnAnimatorMove()
        {
            EOnAnimatorMove?.Invoke();
        }
        private void OnAnimatorIK(int layerIndex)
        {
            EOnAnimatorIK?.Invoke(layerIndex);
        }
        private void OnParticleCollision(GameObject other)
        {
            EOnParticleCollision?.Invoke(other);
        }
        private void OnParticleTrigger()
        {
            EOnParticleTrigger?.Invoke();
        }
        #endregion
    }
}
